ML Module Mania: A Type-Safe, Separately Compiled, Extensible Interpreter

نویسنده

  • Norman Ramsey
چکیده

ML provides unusually powerful mechanisms for building programs from reusable modules. Such power is not available in other popular languages, and programmers accustomed to those languages have wondered if a powerful modules system is really necessary. This paper explores the power of ML modules—including higher-order functors—via an extended programming example. The example solves a problem in the construction of interpreters: how to combine extensibility with separate compilation in a safe language. We focus on a kind of interpreter for which extensibility and separate compilation are especially important: the embedded interpreter. An embedded interpreter implements a reusable scripting language that can be used to control a complex application—like a web server or an optimizing compiler—which is written in a statically typed, compiled host language like ML. The interpreter becomes part of the application, so the application can invoke the interpreter and the interpreter can call code in the application. The idea was first demonstrated by Ousterhout (1990) and has been widely imitated (Benson 1994; Laumann and Bormann 1994; Ierusalimschy, de Figueiredo, and Celes 1996a; Jenness and Cozens 2002; van Rossum 2002). Sometimes a host language can also be used for scripting (Leijen and Meijer 2000), but often it is inconvenient or even impossible to make a host-language compiler available at run time. A scripting language and its interpreter must meet several requirements:

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Mixin’ Up the ML Module System

ML modules provide hierarchical namespace management, as well as fine-grained control over the propagation of type information, but they do not allow modules to be broken up into mutually recursive, separately compilable components. Mixin modules facilitate recursive linking of separately compiled components, but they are not hierarchically composable and typically do not support type abstracti...

متن کامل

A Functional Shell That Operates on Typed and Compiled Applications

Esther is the interactive shell of Famke, a prototype implementation of a strongly typed operating system written in the functional programming language Clean. As usual, the shell can be used for manipulating files, applications, data and processes at the command line. A special feature of Esther is that the shell language provides the basic functionality of a strongly typed lazy functional lan...

متن کامل

Type-Safe Linguistic Run-time Reflection - A Practical Perspective

Reflection is a property of application development systems which permits programs to change their own behaviour. Linguistic reflection is a variety in which this is carried out by extending the program with extra modules which are created, compiled and linked in by the program itself. With run-time reflection this happens during the running of the program. Typically this occurs by including co...

متن کامل

Program Fragments, Linking, and Modularization

Module mechanisms have received considerable theoretical attention , but the associated concepts of separate compilation and linking have not been emphasized. Anomalous module systems have emerged in functional and object-oriented programming where software components are not separately typecheckable and compilable. In this paper we provide a context where linking can be studied, and separate c...

متن کامل

Program Fragments, Linking, and Modularization

Module mechanisms have received considerable theoretical attention , but the associated concepts of separate compilation and linking have not been emphasized. Anomalous module systems have emerged in functional and object-oriented programming where software components are not separately typecheckable and compilable. In this paper we provide a context where linking can be studied, and separate c...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 148  شماره 

صفحات  -

تاریخ انتشار 2006